<template>
  <div class="body">
    <v-head></v-head>
    <Row class="restand">
        <i-col class="standkepu" span="22">
          <div class="detail">
            <div class="standtitle">{{title}}</div>
            <div class="detailzhong">
              <span class="standnum">发布日期:<span class="standnumbz">{{createtime.substring(0,10)}}</span></span>
              <span class="standnum" v-if="metaDescription!='' && metaDescription!=null && metaDescription!=undefined">来源:<span class="standnumbz">{{this.metaDescription}}</span></span>
              <span class="standnum" v-if="author!='' && author!=null && author!=undefined">作者:<span class="standnumbz">{{this.author}}</span></span>
            </div>
            <div class="standfenge1"></div>
            <div class="shijianzhoux" v-html="content">
            </div>
          </div>
        </i-col>
    </Row>
    <v-foot></v-foot>
    <Back-top></Back-top>
  </div>
</template>
<script>
import {neturl} from '../assets/js/common'
export default {
  name: 'seniorsearch',
  data () {
    return {
      content: '',
      title: '',
      createtime: '',
      author: '',
      metaDescription: ''
    }
  },
  methods: {
    logout () {
      this.$cookie.delete('user')
      let routeUrl = this.$router.resolve({
        path: '/'
      })
      window.open(routeUrl.href)
    }
  },
  created () {
    this.$Spin.show()
    // this.model1 = this.cityList[0].value
    this.userinfo = this.$cookie.get('user')
    this.userinfo = JSON.parse(this.userinfo)
    // 已登录
    if (this.userinfo != null) {
      this.islogin = true
      this.islog = false
      this.username = this.userinfo.realName
    }
    // 获取新闻详情
    let newid = this.$route.query.id
    console.log(newid)
    if (newid !== '' && newid !== undefined) {
      let uploadaa = { data: newid }
      this.$axios.post(neturl + '/by/news/getitem', uploadaa
      ).then(res => {
        this.$Spin.hide()
        let it = res.data.data.result
        this.title = it.title
        this.createtime = it.createDate
        this.content = it.content
        this.author = it.author
        this.metaDescription = it.metaDescription
      })
    }
  }
}
</script>

<style scoped>
  @import '../assets/css/newitem.css';
</style>
